#include <iostream>
#include <vector>  

using namespace std;

int main() {
	int n, q;
	cin >> n >> q;
	
	vector<int> pc(n + 1);
	for (int i = 1; i <= n; i++) pc[i] = 1;
	int o = 1;
	
	while (q-- > 0) {
		int x, y;
		cin >> x >> y;
		int ans = 0;
		while (o <= x) {
			ans += pc[o];
			o++;
		}
		pc[y] += ans;
		cout << ans << endl;
	}
	
	return 0;
}

